package jvms.dynamicProxy;

import java.lang.reflect.InvocationHandler;

/**
 * Created by pc on 2015/5/4.
 */

public class ProxyTest {
    public static void main(String args[]) {

        Speak s = new PersonSpeak();
        InvocationHandler h = new SpeakInvocationHandler(s);
        ProxyFactory proxyFactory = new ProxyFactory(PersonSpeak.class.getName(), h);
        Speak speakProxy = (Speak) proxyFactory.createProxyObject();
        //增强版的Speak对象，添加了aop支持
        speakProxy.sayHello();
    }
}
